package com.codelinecounter.rule;

public abstract class CodeLineParserCreator {
	public static enum CodeLineParserClass{
		NORMAL_CODE_LINE,
		WHITE_CODE_LINE,
		MULTIPLE_END_COMMENT_CODE_LINE,
		MULTIPLE_START_COMMENT_CODE_LINE,
		MULTIPLE_MIDDLE_COMMENT_CODE_LINE,
		SINGLE_COMMENT_CODE_LINE
	}
	
	public static CodeLineParser createCodeLineParser(CodeLineParserCreator.CodeLineParserClass classType) throws Exception{
		switch (classType){
			case NORMAL_CODE_LINE:
				return new NormalCodeLineParser();
			case WHITE_CODE_LINE:
				return new WhiteCodeLineParser();
			case MULTIPLE_END_COMMENT_CODE_LINE:
				return new MultipleEndCommentCodeLineParser();
			case MULTIPLE_START_COMMENT_CODE_LINE:
				return new MultipleStartCommentCodeLineParser();
			case SINGLE_COMMENT_CODE_LINE:
				return new SingleCommentCodeLineParser();
			case MULTIPLE_MIDDLE_COMMENT_CODE_LINE:
				return new MultipleMiddleCommentCodeLineParser();
			default:
				throw new Exception("no class type");
		}
	}
}
